package Code.Math.Test;

public class Test2 {
    public static void main(String[] args) {
        //子幂数，一个n位自然数等于自身各个数位上数字的n次幂之和

        int number = 3;

        int count = 0;

        for (int i =(int) Math.pow(10,number-1); i <= (int) Math.pow(10,number) ; i++) {
            int narcissistic_number = 0;
            int temp = i;
            while (temp > 0){
                int ge = temp % 10;
                narcissistic_number += Math.pow(ge,number);
                temp /= 10;
            }

            if (narcissistic_number == i){
                System.out.println(i);
                count ++;
            }
        }

        System.out.println(count);


    }
}
